/**
 * 载入界面
 * by wyy
 */
class loadingScene extends GameObject implements RES.PromiseTaskReporter {
    public maskRect: eui.Rect;

    public displayGrp: eui.Group;
    public progressBar: eui.Rect;
    public progressBg: eui.Rect;
    public progressLbl: eui.Label;

    heightPercent = 1;
    widthPercent = 1;

    constructor() {
        super();
        this.skinName = "resource/eui_skins/game_skins/loadingSceneSkin.exml";
    }
    addToStage() { }
    onRemove() { }
    firstCreate() {
        this.progressBar.mask = this.maskRect;
    }

    onProgress(cur: number, total: number) {
        if ((this.progressBar) && (this.progressBg)) {
            this.progressBar.width = (cur / total) * this.progressBg.width;
        }
    }
}